import request from '@/utils/request'

// 积分类型开始---------------------------
export function getPointTypeList() {
  return request({
    url: '/points/point_type_list/',
    method: 'GET'

  })
}

export function getPointsType(params) {
  return request({
    url: '/points/point_type/',
    method: 'GET',
    params
  })
}

export function addPointsType(data) {
  return request({
    url: '/points/point_type/',
    method: 'POST',
    data
  })
}

export function updatePointsType(data) {
  return request({
    url: `/points/point_type/${data.id}/`,
    method: 'PUT',
    data
  })
}

export function deletePointsType(id) {
  return request({
    url: `/points/point_type/${id}/`,
    method: 'DELETE',
  })
}

export function deletePointsTypes(data) {
  return request({
    url: '/points/point_type/batch_delete/',
    method: 'DELETE',
    data
  })
}

// // 积分类型结束--------------
// // 客户充值开始

export function getRecharges(params) {
  return request({
    url: '/points/recharge/',
    method: 'GET',
    params
  })
}


export function addRecharge(data) {
  return request({
    url: '/points/recharge/',
    method: 'POST',
    data
  })
}


export function updateRecharge(data) {
  return request({
    url: `/points/recharge/${data.id}/`,
    method: 'PUT',
    data
  })
}

export function delRecharge(id) {
  return request({
    url: `/points/recharge/${id}/`,
    method: 'DELETE',
  })
}

export function delRecharges(data) {
  return request({
    url: `/points/recharge/batch_delete/`,
    method: 'DELETE',
    data
  })
}

// // 客户充值结束
// // 积分消费开始

export function getPointConsumes(params) {
  return request({
    url: '/points/consume/',
    method: 'GET',
    params
  })
}


export function addPointConsume(data) {
  return request({
    url: '/points/consume/',
    method: 'POST',
    data
  })
}


export function updatePointConsume(data) {
  return request({
    url: `/points/consume/${data.id}/`,
    method: 'PUT',
    data
  })
}

export function delPointConsume(id) {
  return request({
    url: `/points/consume/${id}/`,
    method: 'DELETE',
  })
}

export function delPointConsumes(data) {
  return request({
    url: `/points/consume/batch_delete/`,
    method: 'DELETE',
    data
  })
}

// // 积分消费结束
// 客户积分列表
export function getCustomerPointsList(params) {
  return request({
    url: '/points/customer_points_list/',
    method: 'GET',
    params
  })
}
